using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       PSObject_DisappearSender.cs
*@brief      send message PSObject_Disappear
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/26
*/

//send message PSObject_Disappear
public class msgPSObject_Disappear
{
    public const int MessageId = (int)PosServerTypes.MessageType.PSObject_Disappear;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public posserver.ObjectDisappear MsgContent = new posserver.ObjectDisappear();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgPSObject_Disappear"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='world_id'>
	/// World_id.
	/// </param>
	/// <param name='object_id'>
	/// Object_id.
	/// </param>
	public msgPSObject_Disappear(int session_id, int world_id, int object_id)
	{
		SessionId = session_id;
		MsgContent.ObjectId = object_id;
		MsgContent.WorldId = world_id;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of PSObject_Disappear</param>
    public static void ProcessMessage(msgPSObject_Disappear msg)
    {
        //TODO
        //Main Message:  msgPosServer
		msgPosServer mainMsg = new msgPosServer(msg.SessionId, msgPSObject_Disappear.MessageId, ProtoNet<posserver.ObjectDisappear>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
